/**
  * New operators
  * 新的操作符
  * 
  * Verilog 2001 introduced two new operator that are of interest to designers. They are
  * 
  * 1. <<< : Shift left, to be used on signed data type
  * 2. >>> : shift right, to be used on signed data type
  * 3. ** : exponential power operator.
  *
  * Verilog 2001引入了两个设计人员感兴趣的新操作符。他们是
  * 1. <<<:算术左移，用于有符号数据类型
  * 2. >>>:算术右移，用于有符号的数据类型
  * 3. **:指数幂操作符。
  *
  * Signed shift operator
  * 有符号移位(算术移位)操作符
*/

module signed_shift();

reg [7:0] unsigned_shift;
reg [7:0] signed_shift;
reg signed [7:0] data = 8'hAA;

initial begin
  $display ("data = %b", data);
  unsigned_shift = data >> 4;
  $display ("unsigned shift = %b", unsigned_shift);
  signed_shift = data >>> 4;
  $display ("signed   shift = %b", signed_shift);
  unsigned_shift = data << 1;
  $display ("unsigned shift = %b", unsigned_shift);
  signed_shift = data <<< 1;
  $display ("signed   shift = %b", signed_shift);
  $finish;
end

endmodule
